<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户选择页面</title>
<style type="text/css">
body {
	background-image: url(background1.jpg);
}
</style>
</head>

<body>
尊敬的用户: 
<?php
$username = $_GET['username'];
echo $username;
?>
<p style="text-align:center;font-family: sans-serif;font-size:20px;color:blue;left:0; top:13px;">
欢迎使用moodle API 简单面板
<br>
请选择您要使用的功能</p>
<form action = "admin-c.php" method = "POST">
<p style="text-align:center;">
<div align="center">
  <table width="202" border="1">
    <tr>
      <td width="161">个人信息查询</td>
      <td width="25"><input align = "center" type="radio" name="choice" value="1" /></td>
    </tr>
    <tr>
      <td>教师教授课程</td>
      <td><input align = "center" type="radio" name="choice" value="2" /></td>
    </tr>
    <tr>
      <td>学生学习课程</td>
      <td><input align = "center" type="radio" name="choice" value="3" /></td>
    </tr>
    <tr>
      <td>提出意见反馈</td>
      <td><input align = "center" type="radio" name="choice" value="4" /></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
        <input align = "center" type="submit" name="button" id="button" value="确定" />      
        <input align = "center" type="reset" name="button" id="button" value="重置" />
      </div></td>
    </tr>
  </table>
</div>
</p>
</from>

<?php
$username = $_GET['username'];
$button = $_POST['choice'];
$show = '';
function select_choice($button)
{
	switch($button)	
	{
		case '1':
			$show = 1;
			break;
		case '2':
			$show = 2;
			break;
		case '3':
			$show = 3;
			break;
		case '4':
			$show = 4;
			break;
		default:
			die('参数错误！');	
	}
	return $show;
}
if($button)
{
	$show = select_choice($button);
	if($show == 1)
	{
	$url = "userinfo-c.php&username=$username";	
	}
	else if($show == 2)
	{
	$url = "teaching-c.php&username=$username";	
	}
	else if($show == 3)
	{
	$url ="classes-c.php&username=$username";
	}
	else if($show == 4)
	{
	$url = "suggestion-c.php&username=$username";
	}
	echo "<script>alert('To jump, click the OK button please');location.href='$url'</script>"; 
    
}
?>
</body>
</html>